![]() |
ClosePort |
||||
Header: | Quickdraw.h | Carbon status: | Unsupported | |
Closes a basic graphics port.
void ClosePort ( GrafPtr port );
A pointer to a GrafPort structure. The ClosePort function releases the memory occupied by this structure’s visRgn and clipRgn fields.
When you’re completely through with a basic graphics port, you can use this function and then dispose of the graphics port with the Memory Manager function DisposePtr (if it was allocated with NewPtr).
The Window Manager calls this function when you close or dispose of a window, and the DisposeGWorld function calls it when you dispose of an offscreen graphics world containing a basic graphics port. When you call the DisposeWindow function to close or dispose of a window, it calls ClosePort and DisposePtr for you. When you use the CloseWindow function, it calls ClosePort, but you must call DisposePtr.
If ClosePort isn’t called before a basic graphics port is disposed of, the memory used by the visible region and the clipping region will be unrecoverable.
The ClosePort function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.
Carbon applications should use CreateNewPort and DisposePort to open and close graphics ports.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)